package exception;

import java.awt.*;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * 以当派生类重写超类含有throws声明
 */
public class TrowsDemo2 {
    public void dosome()throws IOException, AWTException {

    }
}


class SubClass extends TrowsDemo2{
    //相同可以
    //public void dosome()throws IOException, AWTException {}
    //不抛可以
    //public void dosome() {}
    //抛部分可以
    //public void dosome()throws IOException {}
    //抛子类可以
    //public void dosome()throws FileNotFoundException {}

    //额外不行
    //public void dosome()throws IllegalAgeException {}
    //抛父类不行
    //public void dosome()throws Exception {}
}